package com.example.simpleplayer;

import android.util.Log;
import android.view.Surface;

public class MediaPlayer {
    static {
        System.loadLibrary("mymediaplayer");
    }
    /* JNI */
    @SuppressWarnings("unchecked") /* Used from JNI */
    private long mInstance = 0;

    MediaPlayer(){
        NewInstance();
        Log.e("---", "MediaPlayer: "+mInstance);
    }

    public void start(){
        nativestart();
    }

    public void stop(){
        nativestop();
    }

    public void pause(){
        nativepause();
    }

    public void setDataSource(String path){
        nativeSetDataSource(path);
    }

    public void setSurface(Surface surface){
        nativesetSurface(surface);
    }

    private native void NewInstance();
    private native int nativestart();
    private native int nativeSetDataSource(String path);
    private native int nativesetSurface(Surface surface);
    private native int nativepause();
    private native int nativestop();
}
